<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<jsp:include page="/common.jsp"></jsp:include>
<script type="text/javascript">
	function setValue(obj){
			$(obj).parent().find('[name="text"]').val('你好');
	}
</script>
</head>
<body>
<table>
	<thead>
		<tr>
			<th>名字</th>		
		</tr>
	</thead>
	<tbody>
		<tr>
			<td id="td1">
				<input type="text" name="text">
				<button class="btn" onclick="setValue(this)">给td1中的文本框赋值</button>
			</td>
			<td id="td2">
				<input type="text" name="text">
				<button class="btn" onclick="setValue(this)">给td2中的文本框赋值</button>
			</td>
		</tr>
	</tbody>
</table>
</body>
</html>